<?php

namespace app\api\validate;


use \think\Validate;

/**
 *  地址验证码类
 */
class Common extends Validate
{
    protected $rule = [
        'email' => 'require|email',
        'scene' => 'require|number|in:1,2',
    ];

    //定义验证提示
    protected $message = [
        'email.require' => 'getEmailCode.emailRequire',
        'email.email' => 'getEmailCode.emailEmail',
        'scene.require' => 'getEmailCode.sceneRequire',
        'scene.number' => 'getEmailCode.sceneNumber',
        'scene.in' => 'getEmailCode.sceneNumber'
    ];

    //定义验证场景
    protected $scene = [
        'getEmailCode' => ['scene','email']
    ];

}
